Skip to content

Add resilient checkout command#30

Open
mds1 wants to merge 1 commit into
mainfrom
ci/resilient-checkout-command
Open

Add resilient checkout command#30
mds1 wants to merge 1 commit into
mainfrom
ci/resilient-checkout-command

Conversation

@mds1

@mds1 mds1 commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Recent develop failures happened before tests ran because CircleCI checkout failed with empty checkout metadata or SSH transport errors.

Add a shared checkout-code command that checks out CIRCLE_SHA1 over HTTPS with retries and HEAD verification. Update checkout-with-mise to reuse it before installing mise.

@mds1 mds1 force-pushed the ci/resilient-checkout-command branch from a8bd5f9 to 2b5360f Compare June 9, 2026 18:41

repo="${CIRCLE_REPOSITORY_URL:-https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git}"
case "$repo" in
git@github.com:*) repo="https://github.com/${repo#git@github.com:}" ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SSH-to-HTTPS rewrite changes the auth behavior compared to circleci's built-in checkout. For private repos where CIRCLE_REPOSITORY_URL is SSH, this can turn an authenticated checkout into an anonymous HTTPS fetch. Since circleci's built-in checkout is a special step with integration-specific credential handling, a custom git fetch may not be a drop-in replacement for private repos, especially GitHub App HTTPS pipelines.

circlci checkout docs: https://circleci.com/docs/reference/configuration-reference/#checkout


delay=$((attempt * 5))
echo "git fetch failed on attempt ${attempt}; retrying in ${delay}s..."
sleep "$delay"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight improvement: could avoid the sleep here if all 3 attempts failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants